import {
  createApp
} from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementPlus, {
  ElSelect
} from 'element-plus'
import 'element-plus/dist/index.css'
import header from './components/header.vue' //头部组件

// import * as ElIconModules from '@element-plus/icons' //全局导入注册所有icon
import zhCn from 'element-plus/es/locale/lang/zh-cn' // 中文
const app = createApp(App)
// app.use(ElementPlus) //全局引入element - plus
app.use(ElementPlus, {
  locale: zhCn,
})
app.use(router)
app.config.globalProperties.$store = store; //全局注册vuex
app.mount('#app')
app.use(store)
// for (const iconName in ElIconModules) { //注册icon
//   if (Reflect.has(ElIconModules, iconName)) {
//     const item = ElIconModules[iconName]
//     app.component(iconName, item)
//   }
// }

app.component('Header', header) // 注册头部全局组件

import {
  ElMessage
} from 'element-plus' //引入弹出框

app.config.globalProperties.$message = ElMessage; //全局注册alert弹出框
